namespace go note

service Note {
    ResInsertNote insertNote(1:ReqInsertNote req)
    ResDeleteNote deleteNote(1:ReqDeleteNote req)
    ResUpdateNote updateNote(1:ReqUpdateNote req)
    ResGetNoteById getNoteById(1:ReqGetNoteById req)
    ResListNote listNote(1:ReqListNote req)
}

struct ReqInsertNote {
    1:string name
    2:string note
    3:i32 userId
}

struct ResInsertNote {
    1:bool isSuccess
}

struct ReqDeleteNote {
    1:i32 id
    2:i32 userId
}

struct ResDeleteNote {
    1:bool isSuccess
}

struct ReqUpdateNote {
    1:string name
    2:string note
    3:i32 userId
    4: i32 id
}

struct ResUpdateNote {
    1:bool isSuccess
}

struct ReqGetNoteById {
    1:i32 id
    2:i32 userId
}

struct ResGetNoteById {
    1:string name
    2:string note
    3:i32 userId
    4:string createdAt
    5:string updatedAt
    6:i32 id
}
struct ResListNote {
    1:list<ResGetNoteById> notes
    2:i64 total
}

struct ReqListNote {
    1:i32 page
    2:i32 size
    3: i32 userId
    4: i64 total
}
